.class public Llt/noframe/gpsfarmguide/sprayer/CCalcs;
.super Ljava/lang/Object;
.source "CCalcs.java"


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 25
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public ToLonLat(Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/google/android/gms/maps/model/LatLng;
    .locals 8

    .line 199
    iget-wide v0, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    .line 200
    iget-wide v2, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    const-wide v4, 0x41731bf84570a3d7L    # 2.003750834E7

    div-double/2addr v0, v4

    const-wide v6, 0x4066800000000000L    # 180.0

    mul-double v0, v0, v6

    div-double/2addr v2, v4

    mul-double v2, v2, v6

    const-wide v4, 0x400921fb54442d18L    # Math.PI

    mul-double v2, v2, v4

    div-double/2addr v2, v6

    .line 203
    invoke-static {v2, v3}, Ljava/lang/Math;->exp(D)D

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Math;->atan(D)D

    move-result-wide v2

    const-wide/high16 v4, 0x4000000000000000L    # 2.0

    mul-double v2, v2, v4

    const-wide v4, 0x3ff921fb54442d18L    # 1.5707963267948966

    sub-double/2addr v2, v4

    const-wide v4, 0x404ca5dc1a63c1f8L    # 57.29577951308232

    mul-double v2, v2, v4

    .line 204
    new-instance p1, Lcom/google/android/gms/maps/model/LatLng;

    invoke-direct {p1, v2, v3, v0, v1}, Lcom/google/android/gms/maps/model/LatLng;-><init>(DD)V

    return-object p1
.end method

.method public ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;
    .locals 10

    .line 183
    iget-wide v0, p1, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    .line 184
    iget-wide v2, p1, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    const-wide v4, 0x41731bf84570a3d7L    # 2.003750834E7

    mul-double v0, v0, v4

    const-wide v6, 0x4066800000000000L    # 180.0

    div-double/2addr v0, v6

    const-wide v8, 0x4056800000000000L    # 90.0

    add-double/2addr v2, v8

    const-wide v8, 0x400921fb54442d18L    # Math.PI

    mul-double v2, v2, v8

    const-wide v8, 0x4076800000000000L    # 360.0

    div-double/2addr v2, v8

    .line 186
    invoke-static {v2, v3}, Ljava/lang/Math;->tan(D)D

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Math;->log(D)D

    move-result-wide v2

    const-wide v8, 0x3f91df46a2529d39L    # 0.017453292519943295

    div-double/2addr v2, v8

    mul-double v2, v2, v4

    div-double/2addr v2, v6

    .line 188
    new-instance p1, Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {p1, v0, v1, v2, v3}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    return-object p1
.end method

.method public calculateArea(Ljava/util/List;)D
    .locals 22
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/LatLng;",
            ">;)D"
        }
    .end annotation

    move-object/from16 v0, p1

    .line 526
    invoke-interface/range {p1 .. p1}, Ljava/util/List;->size()I

    move-result v1

    const-wide/16 v2, 0x0

    const/4 v4, 0x3

    if-ge v1, v4, :cond_0

    return-wide v2

    :cond_0
    const/4 v1, 0x0

    .line 529
    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/google/android/gms/maps/model/LatLng;

    .line 530
    invoke-interface/range {p1 .. p1}, Ljava/util/List;->size()I

    move-result v5

    const/4 v6, 0x1

    add-int/2addr v5, v6

    new-array v5, v5, [Lcom/vividsolutions/jts/geom/Coordinate;

    const/4 v7, 0x0

    .line 531
    :goto_0
    invoke-interface/range {p1 .. p1}, Ljava/util/List;->size()I

    move-result v8

    if-ge v7, v8, :cond_1

    .line 532
    new-instance v8, Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-interface {v0, v7}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Lcom/google/android/gms/maps/model/LatLng;

    iget-wide v9, v9, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    invoke-interface {v0, v7}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v11

    check-cast v11, Lcom/google/android/gms/maps/model/LatLng;

    iget-wide v11, v11, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    invoke-direct {v8, v9, v10, v11, v12}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    aput-object v8, v5, v7

    add-int/lit8 v7, v7, 0x1

    goto :goto_0

    .line 533
    :cond_1
    invoke-interface/range {p1 .. p1}, Ljava/util/List;->size()I

    move-result v0

    aget-object v7, v5, v1

    aput-object v7, v5, v0

    .line 534
    new-instance v0, Lcom/vividsolutions/jts/geom/GeometryFactory;

    invoke-direct {v0}, Lcom/vividsolutions/jts/geom/GeometryFactory;-><init>()V

    .line 535
    invoke-virtual {v0, v5}, Lcom/vividsolutions/jts/geom/GeometryFactory;->createLinearRing([Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/vividsolutions/jts/geom/LinearRing;

    move-result-object v7

    new-array v1, v1, [Lcom/vividsolutions/jts/geom/LinearRing;

    invoke-virtual {v0, v7, v1}, Lcom/vividsolutions/jts/geom/GeometryFactory;->createPolygon(Lcom/vividsolutions/jts/geom/LinearRing;[Lcom/vividsolutions/jts/geom/LinearRing;)Lcom/vividsolutions/jts/geom/Polygon;

    move-result-object v0

    .line 537
    invoke-virtual {v0}, Lcom/vividsolutions/jts/geom/Geometry;->getCentroid()Lcom/vividsolutions/jts/geom/Point;

    move-result-object v1

    invoke-virtual {v1}, Lcom/vividsolutions/jts/geom/Point;->getX()D

    move-result-wide v7

    .line 538
    invoke-virtual {v0}, Lcom/vividsolutions/jts/geom/Geometry;->getCentroid()Lcom/vividsolutions/jts/geom/Point;

    move-result-object v0

    invoke-virtual {v0}, Lcom/vividsolutions/jts/geom/Point;->getY()D

    move-result-wide v0

    .line 539
    :goto_1
    array-length v9, v5

    if-ge v6, v9, :cond_2

    .line 540
    new-instance v9, Lcom/google/android/gms/maps/model/LatLng;

    aget-object v10, v5, v6

    iget-wide v10, v10, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    aget-object v12, v5, v6

    iget-wide v12, v12, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    invoke-direct {v9, v10, v11, v12, v13}, Lcom/google/android/gms/maps/model/LatLng;-><init>(DD)V

    .line 541
    iget-wide v10, v4, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    sub-double/2addr v10, v7

    const-wide v12, 0x40fb2d77da4a0c32L    # 111319.49079327358

    mul-double v10, v10, v12

    const-wide v14, 0x400921fb54442d18L    # Math.PI

    mul-double v14, v14, v0

    const-wide v16, 0x4066800000000000L    # 180.0

    div-double v14, v14, v16

    invoke-static {v14, v15}, Ljava/lang/Math;->cos(D)D

    move-result-wide v16

    mul-double v10, v10, v16

    .line 542
    iget-wide v12, v4, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    sub-double/2addr v12, v0

    const-wide v18, 0x415854a640000000L    # 6378137.0

    invoke-static/range {v18 .. v19}, Ljava/lang/Math;->toRadians(D)D

    move-result-wide v20

    mul-double v12, v12, v20

    move-object/from16 v20, v5

    .line 543
    iget-wide v4, v9, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    sub-double/2addr v4, v7

    const-wide v16, 0x40fb2d77da4a0c32L    # 111319.49079327358

    mul-double v4, v4, v16

    invoke-static {v14, v15}, Ljava/lang/Math;->cos(D)D

    move-result-wide v14

    mul-double v4, v4, v14

    .line 544
    iget-wide v14, v9, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    sub-double/2addr v14, v0

    invoke-static/range {v18 .. v19}, Ljava/lang/Math;->toRadians(D)D

    move-result-wide v16

    mul-double v14, v14, v16

    mul-double v10, v10, v14

    mul-double v4, v4, v12

    sub-double/2addr v10, v4

    add-double/2addr v2, v10

    add-int/lit8 v6, v6, 0x1

    move-object v4, v9

    move-object/from16 v5, v20

    goto :goto_1

    :cond_2
    const-wide/high16 v0, 0x3fe0000000000000L    # 0.5

    .line 547
    invoke-static {v2, v3}, Ljava/lang/Math;->abs(D)D

    move-result-wide v2

    mul-double v2, v2, v0

    return-wide v2
.end method

.method public cropLineToAreaa(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Ljava/util/List;Ljava/util/Map;)Ljava/util/Map;
    .locals 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/google/android/gms/maps/model/LatLng;",
            "Lcom/google/android/gms/maps/model/LatLng;",
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/LatLng;",
            ">;",
            "Ljava/util/Map<",
            "Lcom/google/android/gms/maps/model/LatLng;",
            "Lcom/google/android/gms/maps/model/LatLng;",
            ">;)",
            "Ljava/util/Map<",
            "Lcom/google/android/gms/maps/model/LatLng;",
            "Lcom/google/android/gms/maps/model/LatLng;",
            ">;"
        }
    .end annotation

    .line 366
    new-instance v0, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    invoke-virtual {p0, p2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p2

    invoke-direct {v0, p1, p2}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 367
    new-instance p1, Ljava/util/ArrayList;

    invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V

    const/4 p2, -0x1

    .line 369
    :goto_0
    invoke-interface {p3}, Ljava/util/List;->size()I

    move-result v1

    add-int/lit8 v1, v1, -0x1

    if-ge p2, v1, :cond_2

    if-gez p2, :cond_0

    .line 373
    new-instance v1, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-interface {p3}, Ljava/util/List;->size()I

    move-result v2

    add-int/lit8 v2, v2, -0x1

    invoke-interface {p3, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v2

    add-int/lit8 v3, p2, 0x1

    invoke-interface {p3, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v3}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v3

    invoke-direct {v1, v2, v3}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    goto :goto_1

    .line 376
    :cond_0
    new-instance v1, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-interface {p3, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v2

    add-int/lit8 v3, p2, 0x1

    invoke-interface {p3, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v3}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v3

    invoke-direct {v1, v2, v3}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 379
    :goto_1
    invoke-virtual {v0, v1}, Lcom/vividsolutions/jts/geom/LineSegment;->intersection(Lcom/vividsolutions/jts/geom/LineSegment;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v1

    if-eqz v1, :cond_1

    .line 381
    invoke-interface {p1, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_1
    add-int/lit8 p2, p2, 0x1

    goto :goto_0

    .line 386
    :cond_2
    invoke-interface {p1}, Ljava/util/List;->isEmpty()Z

    move-result p2

    const/4 p3, 0x0

    if-nez p2, :cond_5

    const/4 p2, 0x0

    .line 387
    :goto_2
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    if-ge p2, v0, :cond_5

    move v0, p2

    .line 388
    :goto_3
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v1

    if-ge v0, v1, :cond_4

    .line 390
    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/vividsolutions/jts/geom/Coordinate;

    .line 391
    invoke-interface {p1, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/vividsolutions/jts/geom/Coordinate;

    .line 392
    iget-wide v3, v1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-wide v5, v1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    add-double/2addr v3, v5

    iget-wide v5, v2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-wide v1, v2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    add-double/2addr v5, v1

    cmpg-double v1, v3, v5

    if-gez v1, :cond_3

    .line 394
    invoke-interface {p1, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/vividsolutions/jts/geom/Coordinate;

    .line 395
    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    invoke-interface {p1, p2, v2}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    .line 396
    invoke-interface {p1, v0, v1}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    :cond_3
    add-int/lit8 v0, v0, 0x1

    goto :goto_3

    :cond_4
    add-int/lit8 p2, p2, 0x1

    goto :goto_2

    .line 401
    :cond_5
    invoke-interface {p1}, Ljava/util/List;->isEmpty()Z

    move-result p2

    if-nez p2, :cond_7

    .line 402
    :goto_4
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result p2

    add-int/lit8 p2, p2, -0x1

    if-ge p3, p2, :cond_7

    .line 404
    rem-int/lit8 p2, p3, 0x2

    if-nez p2, :cond_6

    .line 406
    invoke-interface {p1, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p0, p2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToLonLat(Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object p2

    add-int/lit8 v0, p3, 0x1

    .line 407
    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p0, v0}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToLonLat(Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v0

    .line 408
    invoke-interface {p4, p2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_6
    add-int/lit8 p3, p3, 0x1

    goto :goto_4

    :cond_7
    return-object p4
.end method

.method public distanceBetween(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D
    .locals 10

    const/4 v0, 0x3

    .line 502
    new-array v0, v0, [F

    .line 503
    iget-wide v1, p1, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    iget-wide v3, p1, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    iget-wide v5, p2, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    iget-wide v7, p2, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    move-object v9, v0

    invoke-static/range {v1 .. v9}, Landroid/location/Location;->distanceBetween(DDDD[F)V

    const/4 p1, 0x0

    .line 504
    aget p1, v0, p1

    float-to-double p1, p1

    return-wide p1
.end method

.method public distanceBetweenLineAndPoint(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D
    .locals 18

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p2

    move-object/from16 v3, p3

    .line 470
    new-instance v4, Ljava/util/ArrayList;

    invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V

    .line 471
    invoke-interface {v4, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 472
    invoke-interface {v4, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 473
    invoke-interface {v4, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 475
    invoke-virtual {v0, v4}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->calculateArea(Ljava/util/List;)D

    move-result-wide v4

    .line 476
    invoke-virtual/range {p0 .. p2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->distanceBetween(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v6

    .line 478
    invoke-virtual {v0, v1, v3}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->distanceBetween(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v8

    .line 479
    invoke-virtual {v0, v2, v3}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->distanceBetween(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v1

    const-wide/high16 v10, 0x4000000000000000L    # 2.0

    .line 481
    invoke-static {v6, v7, v10, v11}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v12

    invoke-static {v1, v2, v10, v11}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v14

    add-double/2addr v12, v14

    invoke-static {v12, v13}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide v12

    .line 482
    invoke-static {v6, v7, v10, v11}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v14

    invoke-static {v8, v9, v10, v11}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v16

    add-double v14, v14, v16

    invoke-static {v14, v15}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide v14

    cmpg-double v3, v12, v8

    if-gez v3, :cond_0

    return-wide v1

    :cond_0
    cmpg-double v3, v14, v1

    if-gez v3, :cond_1

    return-wide v8

    :cond_1
    mul-double v4, v4, v10

    div-double/2addr v4, v6

    return-wide v4
.end method

.method public getBearingDifference(DD)D
    .locals 7

    sub-double v0, p1, p3

    const-wide v2, 0x4076800000000000L    # 360.0

    const-wide/16 v4, 0x0

    cmpg-double v6, v0, v4

    if-gez v6, :cond_0

    add-double/2addr v0, v2

    :cond_0
    sub-double/2addr p3, p1

    cmpg-double p1, p3, v4

    if-gez p1, :cond_1

    add-double/2addr p3, v2

    .line 417
    :cond_1
    invoke-static {v0, v1, p3, p4}, Ljava/lang/Math;->min(DD)D

    move-result-wide p1

    return-wide p1
.end method

.method public getBoundingBoxx(Ljava/util/List;)[D
    .locals 14
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/LatLng;",
            ">;)[D"
        }
    .end annotation

    const/4 v0, 0x0

    .line 61
    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v1

    iget-wide v1, v1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    .line 62
    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v3}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v3

    iget-wide v3, v3, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    .line 63
    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v5}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v5

    iget-wide v5, v5, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    .line 64
    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v7}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v7

    iget-wide v7, v7, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    const/4 v9, -0x1

    .line 66
    :goto_0
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v10

    const/4 v11, 0x1

    sub-int/2addr v10, v11

    if-ge v9, v10, :cond_9

    if-gez v9, :cond_0

    .line 70
    new-instance v10, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v12

    sub-int/2addr v12, v11

    invoke-interface {p1, v12}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v11

    check-cast v11, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v11}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v11

    add-int/lit8 v12, v9, 0x1

    invoke-interface {p1, v12}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v12

    check-cast v12, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v12}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v12

    invoke-direct {v10, v11, v12}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    goto :goto_1

    .line 73
    :cond_0
    new-instance v10, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-interface {p1, v9}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v11

    check-cast v11, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v11}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v11

    add-int/lit8 v12, v9, 0x1

    invoke-interface {p1, v12}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v12

    check-cast v12, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v12}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v12

    invoke-direct {v10, v11, v12}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 76
    :goto_1
    iget-object v11, v10, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v11, v11, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    cmpg-double v13, v1, v11

    if-gez v13, :cond_1

    move-wide v1, v11

    .line 78
    :cond_1
    iget-object v11, v10, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v11, v11, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    cmpg-double v13, v3, v11

    if-gez v13, :cond_2

    move-wide v3, v11

    .line 80
    :cond_2
    iget-object v11, v10, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v11, v11, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    cmpl-double v13, v5, v11

    if-lez v13, :cond_3

    move-wide v5, v11

    .line 82
    :cond_3
    iget-object v11, v10, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v11, v11, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    cmpl-double v13, v7, v11

    if-lez v13, :cond_4

    move-wide v7, v11

    .line 84
    :cond_4
    iget-object v11, v10, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v11, v11, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    cmpg-double v13, v1, v11

    if-gez v13, :cond_5

    move-wide v1, v11

    .line 86
    :cond_5
    iget-object v11, v10, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v11, v11, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    cmpg-double v13, v3, v11

    if-gez v13, :cond_6

    move-wide v3, v11

    .line 88
    :cond_6
    iget-object v11, v10, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v11, v11, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    cmpl-double v13, v5, v11

    if-lez v13, :cond_7

    move-wide v5, v11

    .line 90
    :cond_7
    iget-object v10, v10, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v10, v10, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    cmpl-double v12, v7, v10

    if-lez v12, :cond_8

    move-wide v7, v10

    :cond_8
    add-int/lit8 v9, v9, 0x1

    goto/16 :goto_0

    :cond_9
    const/4 p1, 0x4

    .line 93
    new-array p1, p1, [D

    aput-wide v1, p1, v0

    aput-wide v3, p1, v11

    const/4 v0, 0x2

    aput-wide v5, p1, v0

    const/4 v0, 0x3

    aput-wide v7, p1, v0

    return-object p1
.end method

.method public getNearestLineIndexGoogle(Lcom/google/android/gms/maps/model/LatLng;Ljava/util/List;ID)I
    .locals 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/google/android/gms/maps/model/LatLng;",
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/Polyline;",
            ">;ID)I"
        }
    .end annotation

    .line 36
    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    const/4 v0, 0x0

    .line 37
    invoke-interface {p2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v1}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/LatLng;

    invoke-interface {p2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v2}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v2

    const/4 v3, 0x1

    invoke-interface {v2, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v1, v2, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->distanceBetweenLineAndPoint(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v1

    const/4 v4, -0x1

    if-le p3, v4, :cond_0

    .line 40
    invoke-interface {p2, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v4}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v4

    invoke-interface {v4, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/google/android/gms/maps/model/LatLng;

    invoke-interface {p2, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v5}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v5

    invoke-interface {v5, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v4, v5, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->distanceBetweenLineAndPoint(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v4

    cmpg-double v6, v4, p4

    if-gez v6, :cond_0

    return p3

    :cond_0
    const/4 p3, 0x0

    const/4 p4, 0x0

    .line 44
    :goto_0
    invoke-interface {p2}, Ljava/util/List;->size()I

    move-result p5

    if-ge p3, p5, :cond_2

    .line 46
    invoke-interface {p2, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p5

    check-cast p5, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {p5}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object p5

    invoke-interface {p5, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p5

    check-cast p5, Lcom/google/android/gms/maps/model/LatLng;

    invoke-interface {p2, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v4}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v4

    invoke-interface {v4, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, p5, v4, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->distanceBetweenLineAndPoint(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v4

    cmpl-double p5, v1, v4

    if-lez p5, :cond_1

    move p4, p3

    move-wide v1, v4

    :cond_1
    add-int/lit8 p3, p3, 0x1

    goto :goto_0

    :cond_2
    return p4
.end method

.method public ifNotInBounds([DLcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)Z
    .locals 8

    .line 318
    iget-wide v0, p2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    const/4 v2, 0x0

    aget-wide v3, p1, v2

    const/4 v5, 0x1

    cmpl-double v6, v0, v3

    if-lez v6, :cond_0

    iget-wide v0, p3, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    aget-wide v3, p1, v2

    cmpl-double v6, v0, v3

    if-gtz v6, :cond_3

    :cond_0
    iget-wide v0, p2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    aget-wide v3, p1, v5

    cmpl-double v6, v0, v3

    if-lez v6, :cond_1

    iget-wide v0, p3, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    aget-wide v3, p1, v5

    cmpl-double v6, v0, v3

    if-gtz v6, :cond_3

    :cond_1
    iget-wide v0, p2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    const/4 v3, 0x2

    aget-wide v6, p1, v3

    cmpg-double v4, v0, v6

    if-gez v4, :cond_2

    iget-wide v0, p3, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    aget-wide v3, p1, v3

    cmpg-double v6, v0, v3

    if-ltz v6, :cond_3

    :cond_2
    iget-wide v0, p2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    const/4 p2, 0x3

    aget-wide v3, p1, p2

    cmpg-double v6, v0, v3

    if-gez v6, :cond_4

    iget-wide v0, p3, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    aget-wide p2, p1, p2

    cmpg-double p1, v0, p2

    if-gez p1, :cond_4

    :cond_3
    const/4 v2, 0x1

    :cond_4
    return v2
.end method

.method public isLinesIntersect([Lcom/google/android/gms/maps/model/LatLng;[Lcom/google/android/gms/maps/model/LatLng;)Z
    .locals 6

    const/4 v0, 0x4

    .line 142
    new-array v0, v0, [Lcom/vividsolutions/jts/geom/Coordinate;

    const/4 v1, 0x0

    const/4 v2, 0x0

    aput-object v1, v0, v2

    const/4 v3, 0x1

    aput-object v1, v0, v3

    const/4 v4, 0x2

    aput-object v1, v0, v4

    const/4 v5, 0x3

    aput-object v1, v0, v5

    .line 143
    aget-object v1, p1, v2

    invoke-virtual {p0, v1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v1

    aput-object v1, v0, v2

    .line 144
    aget-object p1, p1, v3

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    aput-object p1, v0, v3

    .line 145
    aget-object p1, p2, v2

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    aput-object p1, v0, v4

    .line 146
    aget-object p1, p2, v3

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    aput-object p1, v0, v5

    .line 148
    new-instance p1, Lcom/vividsolutions/jts/geom/LineSegment;

    aget-object p2, v0, v2

    aget-object v1, v0, v3

    invoke-direct {p1, p2, v1}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 149
    new-instance p2, Lcom/vividsolutions/jts/geom/LineSegment;

    aget-object v1, v0, v4

    aget-object v0, v0, v5

    invoke-direct {p2, v1, v0}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 151
    invoke-virtual {p1, p2}, Lcom/vividsolutions/jts/geom/LineSegment;->intersection(Lcom/vividsolutions/jts/geom/LineSegment;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    if-eqz p1, :cond_0

    const/4 v2, 0x1

    :cond_0
    return v2
.end method

.method public linePointByBearingAndDistance(Lcom/google/android/gms/maps/model/LatLng;DDD)Lcom/google/android/gms/maps/model/LatLng;
    .locals 0

    add-double/2addr p2, p6

    .line 452
    invoke-static {p1, p4, p5, p2, p3}, Llt/noframe/gpsfarmguide/utils/geoCalcs/google_m_utils/SphericalUtil;->computeOffset(Lcom/google/android/gms/maps/model/LatLng;DD)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object p1

    return-object p1
.end method

.method public linePointByBearingAndDistancee(Lcom/google/android/gms/maps/model/LatLng;DD)Lcom/google/android/gms/maps/model/LatLng;
    .locals 7

    .line 459
    sget-object v1, Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/Ellipsoid;->WGS84:Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/Ellipsoid;

    .line 460
    new-instance v0, Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/GeodeticCalculator;

    invoke-direct {v0}, Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/GeodeticCalculator;-><init>()V

    .line 461
    new-instance v2, Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/GlobalCoordinates;

    iget-wide v3, p1, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    iget-wide v5, p1, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    invoke-direct {v2, v3, v4, v5, v6}, Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/GlobalCoordinates;-><init>(DD)V

    move-wide v3, p4

    move-wide v5, p2

    .line 462
    invoke-virtual/range {v0 .. v6}, Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/GeodeticCalculator;->calculateEndingGlobalCoordinates(Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/Ellipsoid;Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/GlobalCoordinates;DD)Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/GlobalCoordinates;

    move-result-object p1

    .line 463
    new-instance p2, Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/GlobalCoordinates;->getLatitude()D

    move-result-wide p3

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/utils/geoCalcs/mike_gavaghan/GlobalCoordinates;->getLongitude()D

    move-result-wide v0

    invoke-direct {p2, p3, p4, v0, v1}, Lcom/google/android/gms/maps/model/LatLng;-><init>(DD)V

    return-object p2
.end method

.method public lineSegmentBearing(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D
    .locals 10

    const/4 v0, 0x3

    .line 132
    new-array v0, v0, [F

    .line 133
    iget-wide v1, p1, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    iget-wide v3, p1, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    iget-wide v5, p2, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    iget-wide v7, p2, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    move-object v9, v0

    invoke-static/range {v1 .. v9}, Landroid/location/Location;->distanceBetween(DDDD[F)V

    const/4 p1, 0x1

    .line 134
    aget p1, v0, p1

    float-to-double p1, p1

    return-wide p1
.end method

.method public lineSegmentBearing(Lcom/vividsolutions/jts/geom/LineSegment;)D
    .locals 10

    const/4 v0, 0x3

    .line 105
    new-array v0, v0, [F

    .line 106
    iget-object v1, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p0, v1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToLonLat(Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v1

    iget-wide v1, v1, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    invoke-static {v1, v2}, Ljava/lang/Math;->toRadians(D)D

    move-result-wide v1

    .line 107
    iget-object v3, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p0, v3}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToLonLat(Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v3

    iget-wide v3, v3, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    invoke-static {v3, v4}, Ljava/lang/Math;->toRadians(D)D

    move-result-wide v5

    .line 108
    iget-object v3, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p0, v3}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToLonLat(Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v3

    iget-wide v3, v3, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    invoke-static {v3, v4}, Ljava/lang/Math;->toRadians(D)D

    move-result-wide v3

    .line 109
    iget-object p1, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToLonLat(Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object p1

    iget-wide v7, p1, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    invoke-static {v7, v8}, Ljava/lang/Math;->toRadians(D)D

    move-result-wide v7

    move-object v9, v0

    .line 110
    invoke-static/range {v1 .. v9}, Landroid/location/Location;->distanceBetween(DDDD[F)V

    const/4 p1, 0x1

    .line 111
    aget p1, v0, p1

    float-to-double v0, p1

    return-wide v0
.end method

.method public linesIntersectionPoint([Lcom/google/android/gms/maps/model/LatLng;[Lcom/google/android/gms/maps/model/LatLng;)Lcom/google/android/gms/maps/model/LatLng;
    .locals 7

    const/4 v0, 0x4

    .line 157
    new-array v0, v0, [Lcom/vividsolutions/jts/geom/Coordinate;

    const/4 v1, 0x0

    const/4 v2, 0x0

    aput-object v1, v0, v2

    const/4 v3, 0x1

    aput-object v1, v0, v3

    const/4 v4, 0x2

    aput-object v1, v0, v4

    const/4 v5, 0x3

    aput-object v1, v0, v5

    .line 158
    aget-object v6, p1, v2

    invoke-virtual {p0, v6}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v6

    aput-object v6, v0, v2

    .line 159
    aget-object p1, p1, v3

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    aput-object p1, v0, v3

    .line 160
    aget-object p1, p2, v2

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    aput-object p1, v0, v4

    .line 161
    aget-object p1, p2, v3

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    aput-object p1, v0, v5

    .line 163
    new-instance p1, Lcom/vividsolutions/jts/geom/LineSegment;

    aget-object p2, v0, v2

    aget-object v2, v0, v3

    invoke-direct {p1, p2, v2}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 164
    new-instance p2, Lcom/vividsolutions/jts/geom/LineSegment;

    aget-object v2, v0, v4

    aget-object v0, v0, v5

    invoke-direct {p2, v2, v0}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 166
    invoke-virtual {p1, p2}, Lcom/vividsolutions/jts/geom/LineSegment;->intersection(Lcom/vividsolutions/jts/geom/LineSegment;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    if-nez p1, :cond_0

    return-object v1

    .line 171
    :cond_0
    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToLonLat(Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object p1

    return-object p1
.end method

.method public maxDistncebetweenLines([Lcom/google/android/gms/maps/model/LatLng;[Lcom/google/android/gms/maps/model/LatLng;)D
    .locals 8

    const/4 v0, 0x0

    .line 344
    aget-object v1, p1, v0

    aget-object v2, p2, v0

    invoke-virtual {p0, v1, v2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->distanceBetween(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v1

    move-wide v2, v1

    const/4 v1, 0x0

    .line 346
    :goto_0
    array-length v4, p1

    if-ge v1, v4, :cond_2

    move-wide v3, v2

    const/4 v2, 0x0

    .line 347
    :goto_1
    array-length v5, p2

    if-ge v2, v5, :cond_1

    .line 349
    aget-object v5, p1, v1

    aget-object v6, p2, v2

    invoke-virtual {p0, v5, v6}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->distanceBetween(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v5

    cmpl-double v7, v5, v3

    if-lez v7, :cond_0

    move-wide v3, v5

    :cond_0
    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    :cond_1
    add-int/lit8 v1, v1, 0x1

    move-wide v2, v3

    goto :goto_0

    :cond_2
    return-wide v2
.end method

.method public prolongLine(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;D)[Lcom/google/android/gms/maps/model/LatLng;
    .locals 10

    .line 554
    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    .line 555
    invoke-virtual {p0, p2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p2

    .line 556
    new-instance v0, Lcom/vividsolutions/jts/geom/Coordinate;

    const-wide/16 v1, 0x0

    invoke-direct {v0, v1, v2, v1, v2}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    .line 557
    new-instance v3, Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {v3, v1, v2, v1, v2}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    .line 559
    iget-wide v1, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-wide v4, p2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v1, v4

    const-wide/high16 v4, 0x4000000000000000L    # 2.0

    invoke-static {v1, v2, v4, v5}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v1

    iget-wide v6, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide v8, p2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v6, v8

    invoke-static {v6, v7, v4, v5}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v4

    add-double/2addr v1, v4

    invoke-static {v1, v2}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide v1

    .line 560
    iget-wide v4, p2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-wide v6, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double v6, v4, v6

    div-double/2addr v6, v1

    mul-double v6, v6, p3

    add-double/2addr v4, v6

    iput-wide v4, v0, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    .line 561
    iget-wide v4, p2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide v6, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double v6, v4, v6

    div-double/2addr v6, v1

    mul-double v6, v6, p3

    add-double/2addr v4, v6

    iput-wide v4, v0, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    .line 563
    iget-wide v4, p2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-wide v6, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double v6, v4, v6

    div-double/2addr v6, v1

    mul-double v6, v6, p3

    sub-double/2addr v4, v6

    iput-wide v4, v3, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    .line 564
    iget-wide v4, p2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide p1, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double p1, v4, p1

    div-double/2addr p1, v1

    mul-double p1, p1, p3

    sub-double/2addr v4, p1

    iput-wide v4, v3, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    const/4 p1, 0x2

    .line 566
    new-array p1, p1, [Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {p0, v0}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToLonLat(Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object p2

    const/4 p3, 0x0

    aput-object p2, p1, p3

    invoke-virtual {p0, v3}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToLonLat(Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object p2

    const/4 p3, 0x1

    aput-object p2, p1, p3

    return-object p1
.end method

.method public setShtirch4(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;DLjava/util/List;)Ljava/util/Map;
    .locals 24
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/google/android/gms/maps/model/LatLng;",
            "Lcom/google/android/gms/maps/model/LatLng;",
            "D",
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/LatLng;",
            ">;)",
            "Ljava/util/Map<",
            "Lcom/google/android/gms/maps/model/LatLng;",
            "Lcom/google/android/gms/maps/model/LatLng;",
            ">;"
        }
    .end annotation

    move-object/from16 v6, p0

    move-object/from16 v7, p1

    move-object/from16 v8, p2

    move-object/from16 v9, p5

    .line 228
    invoke-static {}, Lcom/google/android/gms/maps/model/LatLngBounds;->builder()Lcom/google/android/gms/maps/model/LatLngBounds$Builder;

    move-result-object v0

    .line 229
    invoke-interface/range {p5 .. p5}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/google/android/gms/maps/model/LatLng;

    .line 230
    invoke-virtual {v0, v2}, Lcom/google/android/gms/maps/model/LatLngBounds$Builder;->include(Lcom/google/android/gms/maps/model/LatLng;)Lcom/google/android/gms/maps/model/LatLngBounds$Builder;

    goto :goto_0

    .line 231
    :cond_0
    invoke-virtual {v0}, Lcom/google/android/gms/maps/model/LatLngBounds$Builder;->build()Lcom/google/android/gms/maps/model/LatLngBounds;

    move-result-object v0

    .line 233
    invoke-virtual {v6, v9}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->getBoundingBoxx(Ljava/util/List;)[D

    move-result-object v10

    .line 236
    iget-object v1, v0, Lcom/google/android/gms/maps/model/LatLngBounds;->northeast:Lcom/google/android/gms/maps/model/LatLng;

    iget-object v2, v0, Lcom/google/android/gms/maps/model/LatLngBounds;->southwest:Lcom/google/android/gms/maps/model/LatLng;

    invoke-virtual {v6, v1, v2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->distanceBetween(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v11

    .line 238
    invoke-virtual {v0}, Lcom/google/android/gms/maps/model/LatLngBounds;->getCenter()Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v13

    .line 241
    invoke-virtual/range {p0 .. p2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->lineSegmentBearing(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v14

    const-wide v16, 0x4056800000000000L    # 90.0

    add-double v18, v14, v16

    move-object/from16 v0, p0

    move-object v1, v13

    move-wide v2, v11

    move-wide/from16 v4, v18

    .line 243
    invoke-virtual/range {v0 .. v5}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->linePointByBearingAndDistancee(Lcom/google/android/gms/maps/model/LatLng;DD)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v20

    neg-double v2, v11

    .line 244
    invoke-virtual/range {v0 .. v5}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->linePointByBearingAndDistancee(Lcom/google/android/gms/maps/model/LatLng;DD)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v0

    const/4 v13, 0x2

    .line 246
    new-array v1, v13, [Lcom/google/android/gms/maps/model/LatLng;

    const/16 v21, 0x0

    aput-object v7, v1, v21

    const/4 v2, 0x1

    aput-object v8, v1, v2

    new-array v3, v13, [Lcom/google/android/gms/maps/model/LatLng;

    aput-object v20, v3, v21

    aput-object v0, v3, v2

    invoke-virtual {v6, v1, v3}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->maxDistncebetweenLines([Lcom/google/android/gms/maps/model/LatLng;[Lcom/google/android/gms/maps/model/LatLng;)D

    move-result-wide v0

    .line 247
    new-instance v4, Ljava/util/HashMap;

    invoke-direct {v4}, Ljava/util/HashMap;-><init>()V

    add-double/2addr v11, v0

    .line 253
    invoke-virtual {v6, v7, v8, v11, v12}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->prolongLine(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;D)[Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v0

    .line 255
    aget-object v7, v0, v21

    .line 256
    aget-object v8, v0, v2

    .line 277
    invoke-virtual {v6, v7, v8, v9, v4}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->cropLineToAreaa(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Ljava/util/List;Ljava/util/Map;)Ljava/util/Map;

    move-wide/from16 v22, p3

    const/4 v11, 0x0

    :goto_1
    if-ge v11, v13, :cond_2

    move-object/from16 v0, p0

    move-object v1, v7

    move-wide/from16 v2, v22

    move-object v12, v4

    move-wide/from16 v4, v18

    .line 287
    invoke-virtual/range {v0 .. v5}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->linePointByBearingAndDistancee(Lcom/google/android/gms/maps/model/LatLng;DD)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v4

    move-object v1, v8

    move-object v13, v4

    move-wide/from16 v4, v18

    .line 288
    invoke-virtual/range {v0 .. v5}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->linePointByBearingAndDistancee(Lcom/google/android/gms/maps/model/LatLng;DD)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v0

    add-double v22, v22, p3

    .line 291
    invoke-virtual {v6, v13}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v1

    invoke-virtual {v6, v0}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v2

    invoke-virtual {v6, v10, v1, v2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ifNotInBounds([DLcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)Z

    move-result v1

    if-eqz v1, :cond_1

    add-int/lit8 v11, v11, 0x1

    .line 293
    :cond_1
    invoke-virtual {v6, v13, v0, v9, v12}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->cropLineToAreaa(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Ljava/util/List;Ljava/util/Map;)Ljava/util/Map;

    move-object v4, v12

    const/4 v13, 0x2

    goto :goto_1

    :cond_2
    move-object v12, v4

    move-wide/from16 v18, p3

    const/4 v11, 0x0

    :goto_2
    if-ge v11, v13, :cond_4

    sub-double v20, v14, v16

    move-object/from16 v0, p0

    move-object v1, v7

    move-wide/from16 v2, v18

    move-wide/from16 v4, v20

    .line 301
    invoke-virtual/range {v0 .. v5}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->linePointByBearingAndDistancee(Lcom/google/android/gms/maps/model/LatLng;DD)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v4

    move-object v1, v8

    move-object v13, v4

    move-wide/from16 v4, v20

    .line 302
    invoke-virtual/range {v0 .. v5}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->linePointByBearingAndDistancee(Lcom/google/android/gms/maps/model/LatLng;DD)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v0

    add-double v18, v18, p3

    .line 305
    invoke-virtual {v6, v13}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v1

    invoke-virtual {v6, v0}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ToMercator(Lcom/google/android/gms/maps/model/LatLng;)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v2

    invoke-virtual {v6, v10, v1, v2}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->ifNotInBounds([DLcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)Z

    move-result v1

    if-eqz v1, :cond_3

    add-int/lit8 v11, v11, 0x1

    .line 308
    :cond_3
    invoke-virtual {v6, v13, v0, v9, v12}, Llt/noframe/gpsfarmguide/sprayer/CCalcs;->cropLineToAreaa(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;Ljava/util/List;Ljava/util/Map;)Ljava/util/Map;

    const/4 v13, 0x2

    goto :goto_2

    :cond_4
    return-object v12
.end method
